#ifndef _HTTPSERVERSESSION_HPP_
#define _HTTPSERVERSESSION_HPP_

#include "jhdefs.hpp"
#include "net/HTTPSession.hpp"
#include "net/HTTPServerParams.hpp"
#include "net/StreamSocket.hpp"
#include "net/SocketAddress.hpp"
#include "stdlib/timespan.hpp"
using JHCPP::stdlib::CTimeSpan;

NET_NAMESPACE_BEGIN

class CHTTPServerSession : public CHTTPSession
{
public:
	CHTTPServerSession(const CStreamSocket& socket, CHTTPServerParams::Ptr pParams);
	virtual ~CHTTPServerSession();

	bool hasMoreRequests();
	bool canKeepAlive() const;

	CSocketAddress clientAddress();
	CSocketAddress serverAddress();

private:
	bool		m_firstRequest;
	CTimeSpan	m_keepAliveTimeout;
	int			m_maxKeepAliveRequests;
};
NET_NAMESPACE_END

#endif